package context.model;

import java.util.ArrayList;
import java.util.List;

public class Dynamic {
    private long userid;
    private long dynamic_id;
    private long follow_dynamic_id;
    private String dynamic_word;
    private String dynamic_image;
    private String dynamic_video;
    private String dynamic_date;

    private User user;

    private String[] dynamic_imgList;

    private List<Comment> commentList;

    private int imgCount;

    public Dynamic forwardDynamic;

    private long thumbCount;    //点赞这条动态的人数
    private boolean isThumb;    //当前登录的用户有没有给这条动态点赞

    public long getThumbCount() {
        return thumbCount;
    }

    public void setThumbCount(long thumbCount) {
        this.thumbCount = thumbCount;
    }

    public boolean isThumb() {
        return isThumb;
    }

    public void setThumb(boolean thumb) {
        isThumb = thumb;
    }

    public Dynamic getForwardDynamic() {
        return forwardDynamic;
    }

    public void setForwardDynamic(Dynamic forwardDynamic) {
        this.forwardDynamic = forwardDynamic;
    }

    public int getImgCount() {
        return imgCount;
    }

    public List<Comment> getCommentList() {
        return commentList;
    }

    public void setCommentList(List<Comment> commentList) {
        this.commentList = commentList;
    }

    public String[] getDynamic_imgList() {
        return dynamic_imgList;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public long getUserid() {
        return userid;
    }

    public void setUserid(long userid) {
        this.userid = userid;
    }

    public long getDynamic_id() {
        return dynamic_id;
    }

    public void setDynamic_id(long dynamic_id) {
        this.dynamic_id = dynamic_id;
    }

    public long getFollow_dynamic_id() {
        return follow_dynamic_id;
    }

    public void setFollow_dynamic_id(long follow_dynamic_id) {
        this.follow_dynamic_id = follow_dynamic_id;
    }

    public String getDynamic_word() {
        return dynamic_word;
    }

    public void setDynamic_word(String dynamic_word) {
        this.dynamic_word = dynamic_word;
    }

    public String getDynamic_image() {
        return dynamic_image;
    }

    public void setDynamic_image(String dynamic_image) {
        if (dynamic_image == null) {
            return;
        }
        this.dynamic_image = dynamic_image;
        dynamic_imgList = dynamic_image.split(" ");
        imgCount = dynamic_imgList.length;
    }

    public String getDynamic_video() {
        return dynamic_video;
    }

    public void setDynamic_video(String dynamic_video) {
        this.dynamic_video = dynamic_video;
    }

    public String getDynamic_date() {
        return dynamic_date;
    }

    public void setDynamic_date(String dynamic_date) {
        this.dynamic_date = dynamic_date;
    }

    @Override
    public String toString() {
        return "Dynamic{" +
                "userid=" + userid +
                ", dynamic_id=" + dynamic_id +
                ", dynamic_word='" + dynamic_word + '\'' +
                ", dynamic_image='" + dynamic_image + '\'' +
                ", dynamic_video='" + dynamic_video + '\'' +
                ", dynamic_date='" + dynamic_date + '\'' +
                ", imgCount=" + imgCount +
                '}';
    }
}
